-- GENERATED SPELL FOR [Crimson Hand Battle Mage] --


function spell0_20047(pUnit, Event) --@Blizzard,n/a--
pUnit:FullCastSpellOnTarget(37263,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20047', 6000, 1)
end

function spell1_20047(pUnit, Event) --@Cone of Cold,Self--
pUnit:FullCastSpellOnTarget(37265,pUnit)
pUnit:RegisterEvent('Sorts_20047', 8318, 1)
end

function spell2_20047(pUnit, Event) --@Frostbolt Volley,Self--
pUnit:FullCastSpellOnTarget(37262,pUnit)
pUnit:RegisterEvent('Sorts_20047', 6000, 1)
end

function Sorts_20047(pUnit, Event)
local choix_sorts_20047 = math.random(0, 2)
if choix_sorts_20047 == 0 then
pUnit:RegisterEvent('spell0_20047', 1, 1)
end
if choix_sorts_20047 == 1 then
pUnit:RegisterEvent('spell1_20047', 1, 1)
end
if choix_sorts_20047 == 2 then
pUnit:RegisterEvent('spell2_20047', 1, 1)
end
end

function mob20047_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_20047', math.random(1500, 3000), 1)
end

function mob20047_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20047_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20047_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(20047, 1, 'mob20047_Action')
RegisterUnitEvent(20047, 2, 'mob20047_Leave')
RegisterUnitEvent(20047, 3, 'mob20047_Kill')
RegisterUnitEvent(20047, 4, 'mob20047_Die')
